package com.ruoyi.messages.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.messages.mapper.SysBalanceWarningMapper;
import com.ruoyi.messages.domain.SysBalanceWarning;
import com.ruoyi.messages.service.ISysBalanceWarningService;

/**
 * 消息设置Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-27
 */
@Service
public class SysBalanceWarningServiceImpl implements ISysBalanceWarningService
{
    @Autowired
    private SysBalanceWarningMapper sysBalanceWarningMapper;

    /**
     * 查询消息设置
     *
     * @param id 消息设置主键
     * @return 消息设置
     */
    @Override
    public SysBalanceWarning selectSysBalanceWarningById(Long id)
    {
        return sysBalanceWarningMapper.selectSysBalanceWarningById(id);
    }

    /**
     * 查询消息设置列表
     *
     * @param sysBalanceWarning 消息设置
     * @return 消息设置
     */
    @Override
    public List<SysBalanceWarning> selectSysBalanceWarningList(SysBalanceWarning sysBalanceWarning)
    {
        return sysBalanceWarningMapper.selectSysBalanceWarningList(sysBalanceWarning);
    }

    /**
     * 新增消息设置
     *
     * @param sysBalanceWarning 消息设置
     * @return 结果
     */
    @Override
    public int insertSysBalanceWarning(SysBalanceWarning sysBalanceWarning)
    {
        sysBalanceWarning.setCreateTime(DateUtils.getNowDate());
        sysBalanceWarning.setStatus("0");
        sysBalanceWarning.setType("1");
        sysBalanceWarning.setUserId(SecurityUtils.getUserId());
        return sysBalanceWarningMapper.insertSysBalanceWarning(sysBalanceWarning);
    }

    /**
     * 修改消息设置
     *
     * @param sysBalanceWarning 消息设置
     * @return 结果
     */
    @Override
    public int updateSysBalanceWarning(SysBalanceWarning sysBalanceWarning)
    {
        sysBalanceWarning.setUpdateTime(DateUtils.getNowDate());
        return sysBalanceWarningMapper.updateSysBalanceWarning(sysBalanceWarning);
    }

    /**
     * 批量删除消息设置
     *
     * @param ids 需要删除的消息设置主键
     * @return 结果
     */
    @Override
    public int deleteSysBalanceWarningByIds(Long[] ids)
    {
        return sysBalanceWarningMapper.deleteSysBalanceWarningByIds(ids);
    }

    /**
     * 删除消息设置信息
     *
     * @param id 消息设置主键
     * @return 结果
     */
    @Override
    public int deleteSysBalanceWarningById(Long id)
    {
        return sysBalanceWarningMapper.deleteSysBalanceWarningById(id);
    }

    @Override
    public List<SysBalanceWarning> selectSysBalanceWarningByDeptId(Long deptId) {



        return sysBalanceWarningMapper.selectSysBalanceWarningByDeptId(deptId);
    }
}
